package choreganizer;

import java.io.File;


public class DBFileFilter 
extends javax.swing.filechooser.FileFilter
{
   
   private String desc = "Choreganizer database file";
	final private static String ext = "jchore";
   
   public DBFileFilter() 
   {
      setDescription( ext );
   }
   
   public String getExtension()
   {
      return ext;
   }
   
   public void setDescription( String txt )
   {
      desc = txt;
   }
   
   public String getDescription()
   {
      return desc;
   }
   
   public boolean accept(File f)
   {
      String fname = f.getName().toLowerCase();
      if (fname.endsWith( desc ))
         return true;
      else if (f.isDirectory())
         return true;
      else
         return false;
   }
   
} 
